Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stablelib/random

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stablelib/random

Cryptographically-secure pseudorandom number generator

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @stablelib/random?

@stablelib/random is a JavaScript library that provides cryptographically secure random number generation. It is part of the StableLib collection of cryptographic libraries and is designed to be fast, secure, and easy to use.

What are @stablelib/random's main functionalities?

Generating Random Bytes

This feature allows you to generate a specified number of random bytes. In this example, 16 random bytes are generated and logged to the console.

const { randomBytes } = require('@stablelib/random');
const bytes = randomBytes(16);
console.log(bytes);

Generating Random Values

This feature allows you to generate random 32-bit and 64-bit unsigned integers. The example demonstrates generating and logging both types of random values.

const { randomUint32, randomUint64 } = require('@stablelib/random');
const random32 = randomUint32();
const random64 = randomUint64();
console.log(random32, random64);

Generating Random Strings

This feature allows you to generate a random string of a specified length. In this example, a random string of 10 characters is generated and logged to the console.

const { randomString } = require('@stablelib/random');
const str = randomString(10);
console.log(str);

Other packages similar to @stablelib/random

FAQs

Package last updated on 19 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc